<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
                xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:x="http://schemas.microsoft.com/xps/2005/06/resourcedictionary-key">



  <!-- Define decimal format -->
  <xsl:decimal-format name="pt-br-Decimal" grouping-separator="." digit="#" zero-digit="0" decimal-separator="," />


  <xsl:variable name="ServerURL" select="/ProjectDataSet/General/ServerURL"/>

  <xsl:variable name="currentSprintNumber" select ="/ProjectDataSet/Project/Sprint[SprintUId = /ProjectDataSet/Project/CurrentSprintUId]/SprintNumber"/>
  <xsl:variable name="currentPlanSprintUId" select ="/ProjectDataSet/Project/Sprint[SprintNumber = /ProjectDataSet/Project/Baseline]/SprintUId"/>


  <xsl:include href="../../Style.xslt"/>





  <xsl:template name="ArtifactList">
    <xsl:param name="backlogItemUId"/>
    <xsl:param name="artifactGroup"/>
    <xsl:param name="activityName"/>


    <xsl:if test="count(/ProjectDataSet/TaskTail[BacklogItemUId=$backlogItemUId and ActivityName=$activityName and ArtifactGroup=$artifactGroup]) &gt; 0">

      <Table>
        <TableRowGroup>
          <TableRow Style="{{StaticResource GroupRow}}">
            <TableCell>
              <Paragraph>
                <xsl:value-of select="ArtifactGroup"/>
              </Paragraph>
            </TableCell>
          </TableRow>


          <xsl:for-each select="/ProjectDataSet/TaskTail[BacklogItemUId=$backlogItemUId and ActivityName=$activityName and ArtifactGroup=$artifactGroup]">

            <TableRow>
              <TableCell>
                <Paragraph>
                  <xsl:value-of select="ArtifactPath"/>
                </Paragraph>
              </TableCell>
            </TableRow>


          </xsl:for-each>
        </TableRowGroup>
      </Table>

    </xsl:if>


  </xsl:template>

  <xsl:template name="ArtifactListNoGroup">
    <xsl:param name="backlogItemUId"/>
    <xsl:param name="activityName"/>

    <xsl:if test="count(/ProjectDataSet/TaskTail[BacklogItemUId=$backlogItemUId and ActivityName=$activityName and not(ArtifactGroup)]) &gt; 0">

      <Table>
        <TableRowGroup>
          <TableRow Style="{{StaticResource GroupRow}}">
            <TableCell>
              <Paragraph>Unknow Artifact</Paragraph>
            </TableCell>
          </TableRow>


          <xsl:for-each select="/ProjectDataSet/TaskTail[BacklogItemUId=$backlogItemUId and ActivityName=$activityName and not(ArtifactGroup)]">

            <TableRow>
              <TableCell>
                <Paragraph>

                  <xsl:value-of select="ArtifactPath"/>


                </Paragraph>
              </TableCell>
            </TableRow>


          </xsl:for-each>
        </TableRowGroup>
      </Table>

    </xsl:if>




  </xsl:template>


  <xsl:template name="ImpactedItemList">
    <xsl:param name="backlogItemUId"/>

    <xsl:if test="count(/ProjectDataSet/TaskTailImpactedItem[SourceBacklogItemUId=$backlogItemUId]) &gt; 0">
      <Paragraph Background="#DDDDDD" Padding="3" FontSize="12">

        <Bold>Possible Impacted Items</Bold>
        <LineBreak/>


        <xsl:for-each select="/ProjectDataSet/TaskTailImpactedItem[SourceBacklogItemUId=$backlogItemUId]">
          <LineBreak/>
          <xsl:value-of select="Title"/> [<xsl:value-of select="BacklogItemNumber"/>]
          <xsl:if test="not(ProjectUId = /ProjectDataSet/Project/ProjectUId)">            
            <Italic>
              (<xsl:value-of select="ProjectName"/> [<xsl:value-of select="ProjectNumber"/>])
            </Italic>
          </xsl:if>
        </xsl:for-each>

      </Paragraph>

    </xsl:if>


  </xsl:template>




</xsl:stylesheet>

